import urllib.request
class PageManager:
    __pageUrlPool=[]
    
    @classmethod
    def __getPage(self,url):
        request=urllib.request.Request(url)
        response=urllib.request.urlopen(request)
        return response.read().decode('gb2312')
    
    def getPage(self):
        if len(self.__pageUrlPool)!=0:
            return PageManager.__getPage(self.__pageUrlPool.pop())
    
    def addPageUrl(self,url):
        self.__pageUrlPool.append(url)
        return
    
    def addPageUrls(self,urls):
        self.__pageUrlPool.extend(urls)